<%@page import="com.blockchain.front.servlets.password.Reset"%>
<%@page import="com.blockchain.front.servlets.LoginVerify"%>
<%@page import="com.blockchain.front.servlets.Login"%>
<%@page import="com.blockchain.front.servlets.Register"%>
<div id="all_mask" class="all_mask" style="height: 0px; display: none;"></div>
<div class="all_mask_loginbox" style="top: 313px; display: none;">
    <div class="login_title pl20"><%=languageDefine.getValue(request, "login_login")%></div>
     <form  id="form-login" class="mask_wrap login-fb">
 	<div class="login_text zin90">
            <div class="mask_wrap_title"><%=languageDefine.getValue(request, "login_accountNumber")%>：</div>
            <input id="login_username" name="username" type="text" placeholder='<%=languageDefine.getValue(request, "login_pleaseEnterEmail")%>'>
        </div>
        <div class="login_text zin80">
            <div class="mask_wrap_title"><%=languageDefine.getValue(request, "login_password")%>：</div>
            <input id="login_password" name="password" type="password" placeholder='<%=languageDefine.getValue(request, "login_pleaseEnterPassword")%>'>
        </div>
        <div class="login_text zin70" id="ga-box-login">
		<div class="mask_wrap_title"><%=languageDefine.getValue(request, "login_verificationCode")%>：</div>
            <input type="text" id="login_gacode" value="" placeholder='<%=languageDefine.getValue(request, "login_pleaseEnterVerificationCode")%>' style="width: 100px;" maxlength="4">
            <img  id="login_yzm" onclick="this.src='<%=controller.getURI(request, LoginVerify.class)%>?'+Math.random()" src="<%=controller.getURI(request, LoginVerify.class)%>" width="120" style="float: right;height: 40px;" alt="" />
            <div style="height:12px;" class="com_warning"  id="cuxx"></div>
        </div>
        <div class="login_button">
            <input type="button" value='<%=languageDefine.getValue(request, "login_login")%>' onclick="upLogin();" >
        </div>
        <div class="login-footer wwxwwx" style="border-bottom-left-radius: 3px; border-bottom-right-radius: 3px;">
            <span style="color: #CCC; float: right; margin-right: 25px;">
			<a style="font-size: 12px;" href="<%=controller.getURI(request, Register.class)%>"><%=languageDefine.getValue(request, "login_freeRegister")%></a> <a href="<%=controller.getURI(request, Reset.class)%>" style="font-size: 12px;"><%=languageDefine.getValue(request, "login_forgetPassword")%></a></span>
        </div>
    </form>
    <div class="mask_wrap_close" onclick="wrapClose()"></div>
</div>
<script type="text/javascript">
function upLogin() {
	var username = $("#login_username").val();
    var password = $("#login_password").val();
    var verifyCode=$("#login_gacode").val();
    var _z = $("#_z").val();
    if (username == "" || username == null) {
        layer.tips('<%=languageDefine.getValue(request, "login_pleaseEnterPhone")%>', '#login_username', {tips: 3});
        return false;
    }
    if (password == "" || password == null) {
        layer.tips('<%=languageDefine.getValue(request, "login_pleaseEnterPassword")%>', '#login_password', {tips: 3});
        return false;
    }
    if(verifyCode==""||verifyCode==null){
    	 layer.tips('<%=languageDefine.getValue(request, "login_pleaseEnterVerificationCode")%>', '#login_gacode', {tips: 3});
          return false;
    }
     $.post('<%=controller.getURI(request, Login.class)%>', {
        username: username,
        password: password,
        verifyCode: verifyCode,
    }, function (data) {
        if (data== 1) {
        	$('.all_mask').hide();
            $('.all_mask_loginbox').hide();
            //window.location=window.location.href;
            location.reload();
        } else {
        	$("#login_yzm").click();
        	$('#cuxx').html(data.indexOf("err_")!=-1?eval("_error_global."+data):data);
        }
    });
}
</script> 